CC := g++
CFLAGS := -std=c++11 -g

main.out: main.o HTTP_Server.o Epoll.o ThreadPool.o HTTP_Request.o timer.o log.o
	$(CC) $(CFLAGS) -o main.out main.o HTTP_Server.o Epoll.o ThreadPool.o HTTP_Request.o timer.o log.o -lpthread

main.o: main.cpp HTTP_Server.hpp Common.hpp
	$(CC) $(CFLAGS) -c main.cpp -lpthread

HTTP_Server.o: HTTP_Server.cpp HTTP_Server.hpp Epoll.hpp ThreadPool.hpp Common.hpp HTTP_Request.hpp
	$(CC) $(CFLAGS) -c HTTP_Server.cpp -lpthread

Epoll.o: Epoll.cpp Epoll.hpp Common.hpp
	$(CC) $(CFLAGS) -c Epoll.cpp -lpthread

ThreadPool.o: ThreadPool.cpp ThreadPool.hpp Common.hpp
	$(CC) $(CFLAGS) -c ThreadPool.cpp -lpthread

HTTP_Request.o: HTTP_Request.cpp HTTP_Request.hpp Common.hpp
	$(CC) $(CFLAGS) -c HTTP_Request.cpp -lpthread

timer.o: timer.cpp timer.hpp Common.hpp
	$(CC) $(CFLAGS) -c timer.cpp -lpthread

log.o: log.cpp log.hpp Common.hpp
	$(CC) $(CFLAGS) -c log.cpp -lpthread

.PHONY: clean
clean:
	rm -f *.o *.out